package com.mitaotao._1_语法._4_循环.单循环._01_输出最大值;

import java.util.Scanner;

public class _01_3_依次输入10个数输出最大值 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num,max;
        max = Integer.MIN_VALUE;

        for (int n=0;n<10;n++){
            System.out.println("请输入第"+(n+1)+"个数字：");
            num = scanner.nextInt();
            if (num>max){
                max = num;
            }
        }
        System.out.println("最大值为："+max);
        scanner.close();
    }
}
